package com.yatop.lalmbda.ai.service.impl;

import com.yatop.lalmbda.ai.model.Account;
import com.yatop.lalmbda.ai.service.AccountService;
import com.yuyaogc.lowcode.engine.annotation.Service;
import com.yuyaogc.lowcode.engine.plugin.activerecord.Criteria;

import java.math.BigDecimal;

@Service
public class AccountServiceImpl implements AccountService {

    @Override
    public BigDecimal accountBalance(Long userId) {
       Account account = Account.selectOne(Account.class, Criteria.equal("userId", userId));
        return account.getAccountBalance();
    }

    @Override
    public Account selectOne(Criteria criteria) {
        return Account.selectOne(Account.class, criteria);
    }
}
